home *** CD-ROM | disk | FTP | other *** search
Wrap
/* v1.03 Restore Marko Seppänen marko.seppanen@wwnet.fi */ address IMAGEENGINEER Options results signal on error NL='0a'x if exists("ie:prefs/shutdownimagelist.cfg") == 0 then do 'REQUEST "There is nothing to restore!" "Sorry"' exit end PROJECT_LIST imagelist=result if imagelist ~== "" then do 'REQUEST "Would you like to close current'||NL||'windows before proceeding?" "Yes|No|Cancel"' if result = 0 then exit if result = 1 then do if exists("IE:Arexx/CloseAll.rexx") then ADDRESS COMMAND "Sys:Rexxc/RX IE:Arexx/CloseAll.rexx" else do 'REQUEST "Can not close windows.'||NL||'Download latest version of Image Engineer." "Continue|Stop"' if result = 0 then exit end end end if exists("ie:prefs/shutdown.cfg") == "1" then do call open("temp","ie:prefs/shutdown.cfg","R") values=readln("temp") parse var values ok fileformat savepath . call close("temp") end else do 'REQUEST "Error requester appeared!" "My fault, sorry"' if result = 0 then exit end savepath=strip(savepath,B,'"') call open("temp","ie:prefs/shutdownimagelist.cfg","R") do forever fullline=readln("temp") if fullline == "" then call settings select when word(fullline,1) == "PRIMARY" then primarypic=word(fullline,2) when word(fullline,1) == "ALPHA" then alphapic=word(fullline,2) when word(fullline,1) == "SECONDARY" then secpic=word(fullline,2) otherwise do parse var fullline iname pictype piczoom picx picy posx posy winwidth winheight . if pictype == "GREY" then OPEN "'"savepath||iname"'" GREY else OPEN "'"savepath||iname"'" COLOUR imagename=iname PROJECT_SET imagename ZOOM piczoom i=0;do until i=2000;i=i+1;end PROJECT_SET imagename WINDOW posx posy winwidth winheight i=0;do until i=2000;i=i+1;end PROJECT_SET imagename OFFSETS picx picy ADDRESS COMMAND "c:delete "savepath||iname" QUIET" end end end exit settings: call close("temp") if secpic ~== "" then MARK secpic SECONDARY if alphapic ~== "" then MARK alphapic ALPHA if primarypic ~== "" then MARK primarypic PRIMARY ADDRESS COMMAND "c:delete ie:prefs/shutdownimagelist.cfg QUIET" exit /*******************************************************************/ /* This is where control goes when an error code is returned by IE */ /* It puts up a message saying what happened and on which line */ /*******************************************************************/ error: if RC=5 then do /* Did the user just cancel us? */ IE_TO_FRONT LAST_ERROR 'REQUEST "'||RESULT||'"' exit end else do IE_TO_FRONT LAST_ERROR 'REQUEST "Error detected!!!'||D2C(10)||'Image Engineer error message is as follows'||D2C(10)||result||D2C(10)||'Script failed on line '||SIGL||'"' 'Doh!' exit end